• Patch as Patch Can or, How to patch the Mac OS 8 Finder to work the way you want by Jerry Kindall mailto:kindall@manual.com Manual Labor http://www.manual.com/ Introduction ___________ Half the email I got about my Finder patch asked me how to change something I patched. So that’s why I’m writing this little file. You will need a copy of ResEdit to follow along. You can download a copy from Apple’s FTP site; it’s free. Try ftp://ftp.info.apple.com/Apple.Support.Area/Apple.Software.Updates/US/Macintosh/Utilities/ResEdit_2.1.3.sea.hqx (whew!). If you plan to do a lot of this kind of stuff, buy yourself a copy of Resorcerer from Mathemæesthetics. You’ll be glad you did. Find out more at http://www.mathemaesthetics.com/. Make these patches only to a copy of the Finder. Remember, you can’t change a copy of the Finder that’s running. It’s best to follow the procedure I outlined in my instructions for actually installing the patch: option-drag the running Finder to the desktop, drop it on ResEdit and make the desired changes, move the running Finder to the Trash, move the edited Finder into the System Folder, and restart. Don’t empty the Trash until you’ve tested the new Finder to make sure it works properly. Without further ado, here’s a brief explanation of the Finder’s resources. Resource Types ______________ Upon opening the Finder in ReEdit, you’ll see a bunch of icons, each representing a different kind of resource. Resource types are identified with four-character codes, such as “STR#” or “PICT” or “snd “. (Although “snd “ looks like a three-character code, the fourth character is a space, and is part of the type identifier.) The four resource types we’re most interested in for our nefarious purposes are: STR (that’s S-T-R-space) is a single piece of text: a string. These kinds of resources hold various bits of text used by the Finder. (They’re in STR resources, rather than in the Finder’s code, to make them easier to change for other languages.) STR# is what’s called a string list (the # is a convention meaning “list”). Basically, instead of storing individual strings like a STR resource, a STR# resource holds a group of strings which are somehow related. It’s up to the programmer to decide how to organize his strings and to decide what STR# (or STR) resource they should go in. PICT stores pictures. ResEdit lets you just paste them in. Easy enough, huh? fmn2 stores Finder menus. Usually menus would be stored in MENU resources (makes sense, huh?). But with System 7.5, Apple’s programmers discovered that they needed to store more information with each menu than was possible in a MENU resource, so they invented the fmnu (Finder menu) resource. With Mac OS 8.0, they needed to make some more changes, and invented the fmn2 resource. In case you’re wondering, upper case and lower case make a difference when dealing with resource types. A MENU is not a Menu, if you catch my drift, although it is (generically) a menu. The good news about editing menus in ResEdit is that the program has a built-in menu editor that’s quite easy to use. The bad news is that it only works with MENU resources. However, I’ve included a copy of Satoru Iwatsu’s fmn2 template, which makes it possible to edit fmn2 resources in a semi-friendly manner. Editing STRs ___________ Let’s go STR-hunting first. It’s the easiest. Double-click the STR icon in the Finder window. A list of all the available STR resources will appear, in what’s called a picker window. Each resource of a given type has a unique number, which appears in the picker’s leftmost column. The second column indicates the size (in bytes) of each resource. The third column is the resource’s name. (None of the STR resources in the Finder have a name.) To edit a STR resource, just double-click it. ResEdit displays the text in a window and allows you to edit it. Try STR 4000; this string is the one the Finder uses for the title of the “About This Computer” (or “About This Macintosh”) window. Other bits of text of interest will become obvious; just browse a little. (If you have Resourceror, you can use its Find command to help you hunt.) Editing STR#s _____________ Opening the STR# icon displays another picker much like the STR one. But when you open a particular STR# resource, you see not a single string but a number of them in a scrollable window. Simply tab from one to the next. Here are some STR#s you should check out: Resource ID String # Function 4500 3 Name of new folder (”untitled folder” is the default) 4500 4 “copy” suffix for duplicate files. Delete entirely for the behavior documented in my patch. Don’t forget to put the space in front if you want some other suffix 8200 1 “alias” suffix for Make Alias command; includes the space between the name of the file and the suffix 4000 6 Text used for “About this Computer” menu item. The ^0 means that either the text “Computer” or “Macintosh” will be inserted at runtime. Just change to whatever text you want. 5816 1 This is the text used for font samples Editing PICTs ____________ To edit a pict, you just doeble-click it in the PICT picker, then paste in the new image. The pic displayed in the “About” window is PICT ID 4000 and is 248 pixels wide and 42 pixels high. If you want the picture to look good on a 256-color screen, be sure to convert it to the 8-bit Macintosh system palette before pasting it in. Editing fmn2s _____________ Editing these becomes much easier with the fmn2 template included with this file. Just open the included template (which was designed by Satoru Iwatsu) in ResEdit. Leave it open while you also open a fmn2 resource in the Finder. Resources 520 through 524 hold the five menus for the “standard” Finder. Resources 526 through 530 hold the menus for the “simple” Finder. (Increase these resource IDs by one under Mac OS 8.5. Don’t ask me why.) As you scroll the window that holds the menu, you’ll see a number of different fields for each menu. You can freely edit the ShortCut or MenuItem for any displayed menu item. To delete a menu item, click the number of the item to be deleted (it’ll have a row of asterisks next to it). Then hit the Delete key. You will also need to decrease the Count field at the top of the resource by one. To insert a menu item, click the number that you want the new menu item to be, then choose “Insert New Field(s)” from the Resource menu. Enter the four-character command code in the Command field, leave Flag and unused set to zero, and enter the menu item’s desired shortcut and text. (You can find out the code for a command by looking at the other menu resources. “quit” is the code for the Quit Finder command.) Again, be sure to edit the Count field at the top of the resource to reflect the fact that you added a new menu item. To add a separator, use a Menu Item of “-” (hyphen). The Command and ShortCut are ignored. Memory Allocation _________________ Edit the SIZE -1 resource. Scroll down to the bottom of the window and change the Size field, which is the application’s memory allocation in bytes. Do not under any circumstances change any of the other things in this window. Done! _____ Don’t forget to save! Hope you enjoyed this brief tour of Finder patching. __ Last Modified: 20 May 1999 JEK